const Sequelize = require('sequelize');
const sequelize = require('../dbConn.js');

const { STRING, INTEGER, DATE } = Sequelize;

class Project extends Sequelize.Model {}

class Activity extends Sequelize.Model {}

Project.init(
    {
        id: {
            type: INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true,
            unique: true
        },
        cover: STRING,
        title: STRING,
        description: STRING
    },
    {
        sequelize,
        modelName: 'Project'
    }
);

Activity.init(
    {
        id: {
            type: INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true,
            unique: true
        },
        nickname: STRING,
        avatar: STRING,
        name: STRING,
        action: STRING,
        event: STRING,
        time: STRING
    },
    {
        sequelize,
        modelName: 'Activity'
    }
);

module.exports = {
    Project,
    Activity
};
